package com.zhentao.controller;

import com.zhentao.model.banner.dto.BannerDto;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.realname.dto.RealnameDto;
import com.zhentao.model.realname.pojo.ApRealname;
import com.zhentao.service.ApRealnameService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/v1/app/realname")
@Api(tags = "UserRealnameController-后台用户实名管理")
public class UserRealnameController {
    @Resource
    ApRealnameService apRealnameService;
    @ApiOperation("查询所有用户实名信息")
    @PostMapping("/list")
    public ResponseResult list(@RequestBody RealnameDto dto){
        return apRealnameService.getlist(dto);
    }

    /**
     * 删除用户实名信息(根据id)
     * @param id
     * @return
     */
    @PostMapping("del")
    @ApiOperation("删除用户实名信息")
    public ResponseResult del(@RequestParam("id") int id){
        apRealnameService.removeById(id);
        return ResponseResult.okResult("删除成功");
    }


}
